//
//  ExchangeImplementViewController.m
//
//  Created by 周成龙
//

#import "ExchangeImplementViewController.h"

#import <objc/runtime.h>

@implementation NSString (ExchangeImplement)

+ (void)load {
    Method imp1 = class_getInstanceMethod(self, @selector(uppercaseString));
    Method imp2 = class_getInstanceMethod(self, @selector(z_uppercaseString));
    method_exchangeImplementations(imp1, imp2);
}

- (NSString *)z_uppercaseString {
    NSString *uppercaseString = [self z_uppercaseString];
    NSLog(@"%@ => %@", self, uppercaseString);
    return uppercaseString;
}
@end

@interface ExchangeImplementViewController ()

@end

@implementation ExchangeImplementViewController
#pragma mark - LifeCycle
- (void)viewDidLoad {
    [super viewDidLoad];
    
//    NSObject
//    NSProxy
    
    NSString *string = @"你好啊 ThIs is tHE stRiNg 你好啊";
    [string uppercaseString];
}

@end

